import Vue from 'vue'
import Router from 'vue-router'
import Whole from '@/views/index'
import notFount from '@/views/404.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'whole',
      component: Whole,
      meta: { title: '首页' },
      redirect: '/Home',
      children:[
        // 首页
        {
          path: '/Home',
          component: () => import('@/views/Home'),
          name: 'home',
        },
        // 关于我们
        {
          path: '/AboutUs',
          name: 'aboutUs',
          component: () => import('@/views/aboutUs/index'),
          meta: {
            title: '关于我们',
          },
          redirect: 'AboutUs/introduce',
          children: [
            // 基本介绍
            {
              path: '/AboutUs/introduce',
              component: () => import('@/views/aboutUs/introduce'),
              name: 'aboutUsIntroduce'
            },
            // 发展历史
            {
              path: '/AboutUs/history',
              component: () => import('@/views/aboutUs/history'),
              name: 'aboutUsHistory'
            },
            // 内容团队
            {
              path: '/AboutUs/personal',
              component: () => import('@/views/aboutUs/personal'),
              name: 'aboutUsPerson'
            },
            // 管理团队
            {
              path: '/AboutUs/team',
              component: () => import('@/views/aboutUs/team'),
              name: 'aboutUsTeam'
            },
            // 业务介绍
            {
              path: '/AboutUs/business',
              component: () => import('@/views/aboutUs/business'),
              name: 'aboutUsBusiness'
            }
          ]
        },
        //  社会责任
        {
          path: '/Responsibility',
          component: () => import('@/views/Responsibility'),
          name: 'responsibility'
        },
        // 案例展示
        {
          path: '/Case',
          component: () => import('@/views/Case'),
          name: 'case'
        },
        // 新闻中心
        {
          path: '/News',
          component: () => import('@/views/news/index'),
          name: 'news',
        },
        // 新闻详情
        {
          path: 'News/details',
          component: () => import('@/views/news/details'),
          name: 'newsDetails'
        },
        // 联系我们
        {
          path: '/ContactUs',
          component: () => import('@/views/ContactUs'),
          name: 'contactUs'
        }
      ]
    },
    {
      path: '*',
      component: notFount,
      name: 'notFount'
    },
  ]
})
